package game_elements_layer.field_stuff.locations_stuff;

import game_elements_layer.guys_stuff.Guys;
import game_elements_layer.productions_stuff.Productions;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: vych0914
 * Date: 06.10.14
 * Time: 16:39
 * To change this template use File | Settings | File Templates.
 */

public class Locations {

    /** название локации */
    private String name;
    /** прилегающие локации */
    private ArrayList<Locations> nearbyLocations;
    /** производство в данной локации */
    private Productions containedProduction;
    /** стоящий на локации приближенный */
    private Guys containedGuy;

    public Locations(){
        this.name="";
        this.nearbyLocations = new ArrayList<Locations>();
        this.containedProduction = null;
        this.containedGuy = null;
    }

    public Locations(ArrayList<Locations> nearbyLocations, Productions containedProduction, String name) {
        this.nearbyLocations = nearbyLocations;
        this.containedProduction = containedProduction;
        this.name=name;
    }

    public ArrayList<Locations> getNearbyLocations() {
        return nearbyLocations;
    }

    public boolean addNewNearbyLocation(Locations l){
        return this.nearbyLocations.add(l);
    }

    public boolean addNewArrayOfNearbyLocations(ArrayList<Locations> additionalNearbyLocations){
        return this.nearbyLocations.addAll(additionalNearbyLocations);
    }

    public void setContainedProduction(Productions production){
        this.containedProduction = production;
    }

    public Productions getContainedProduction() {
        return containedProduction;
    }

    @Override
    public String toString() {
        return "Location " + name ;
    }
}
